<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>YOLO Vision AI Platform</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- Tailwind配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CFC9',
                        success: '#52C41A',
                        warning: '#FAAD14',
                        danger: '#FF4D4F',
                        dark: '#1D2129',
                        'dark-2': '#4E5969',
                        'light-1': '#F2F3F5',
                        'light-2': '#E5E6EB',
                        'light-3': '#C9CDD4'
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                    boxShadow: {
                        'card': '0 2px 8px rgba(0, 0, 0, 0.08)',
                        'dropdown': '0 4px 16px rgba(0, 0, 0, 0.12)',
                        'hover': '0 4px 12px rgba(22, 93, 255, 0.15)',
                    }
                },
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                scrollbar-width: none;
                -ms-overflow-style: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .text-gradient {
                background-clip: text;
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
            }
            .transition-all-300 {
                transition: all 300ms ease-in-out;
            }
            .card-hover {
                @apply hover:shadow-hover hover:-translate-y-1 transition-all-300;
            }
        }
    </style>
</head>
<body class="font-inter bg-gray-50 text-dark overflow-hidden h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="bg-white border-b border-light-2 h-16 flex items-center justify-between px-6 shadow-sm z-30">
        <!-- 左侧Logo和标题 -->
        <div class="flex items-center space-x-4">
            <button id="sidebar-toggle" class="lg:hidden text-dark-2 hover:text-primary transition-all-300">
                <i class="fa fa-bars text-xl"></i>
            </button>
            <div class="flex items-center space-x-2">
                <div class="w-8 h-8 rounded-md bg-primary flex items-center justify-center">
                    <i class="fa fa-eye text-white"></i>
                </div>
                <h1 class="text-xl font-bold text-primary">YOLO Vision AI</h1>
            </div>
        </div>
        
        <!-- 右侧工具栏 -->
        <div class="flex items-center space-x-6">
            <!-- 角色切换器 -->
            <div class="hidden md:flex items-center space-x-2 bg-light-1 px-3 py-1.5 rounded-lg">
                <span class="text-sm text-dark-2">当前角色：</span>
                <select id="role-selector" class="bg-transparent border-none focus:outline-none text-sm font-medium">
                    <option value="user">普通用户</option>
                    <option value="team-admin">团队管理员</option>
                    <option value="sys-admin" selected>系统管理员</option>
                </select>
            </div>
            
            <button class="relative text-dark-2 hover:text-primary transition-all-300">
                <i class="fa fa-bell text-xl"></i>
                <span class="absolute -top-1 -right-1 w-4 h-4 bg-danger rounded-full text-white text-xs flex items-center justify-center">3</span>
            </button>
            <button class="relative text-dark-2 hover:text-primary transition-all-300">
                <i class="fa fa-question-circle text-xl"></i>
            </button>
            <div class="flex items-center space-x-2 cursor-pointer group">
                <img src="https://picsum.photos/id/1005/200/200" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-transparent group-hover:border-primary transition-all-300">
                <span class="hidden md:inline font-medium">张工程师</span>
                <i class="fa fa-angle-down text-dark-2 group-hover:text-primary transition-all-300"></i>
            </div>
        </div>
    </header>

    <div class="flex flex-1 overflow-hidden">
        <!-- 侧边栏导航 -->
        <aside id="sidebar" class="w-64 bg-white border-r border-light-2 flex-shrink-0 hidden lg:block transition-all duration-300 ease-in-out transform z-20">
            <nav class="py-6 h-full flex flex-col">
                <div class="px-4 mb-6">
                    <p class="text-xs uppercase text-dark-2 font-semibold tracking-wider">项目管理</p>
                </div>
                
                <ul class="space-y-1 px-2 mb-6">
                    <li>
                        <a href="home.html" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg bg-primary/5 text-primary font-medium transition-all-300">
                            <i class="fa fa-briefcase w-5 text-center"></i>
                            <span>我的项目</span>
                        </a>
                    </li>
                    <li>
                        <a href="project_template.html" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-file-text-o w-5 text-center"></i>
                            <span>项目模板库</span>
                        </a>
                    </li>
                    <li>
                        <a href="project_recycle.html" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-trash-o w-5 text-center"></i>
                            <span>项目回收站</span>
                        </a>
                    </li>
                </ul>
                
                <div class="px-4 mb-6">
                    <p class="text-xs uppercase text-dark-2 font-semibold tracking-wider">资源中心</p>
                </div>
                
                <ul class="space-y-1 px-2 mb-6">
                    <li>
                        <a href="public_datasets.html" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-database w-5 text-center"></i>
                            <span>公共数据集</span>
                            <!-- 管理员可见的管理标识 -->
                            <span class="ml-auto bg-light-1 text-dark-2 text-xs px-1.5 py-0.25 rounded">管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-cubes w-5 text-center"></i>
                            <span>预训练模型库</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-book w-5 text-center"></i>
                            <span>文档中心</span>
                        </a>
                    </li>
                </ul>
                
                
                <!-- 仅系统管理员可见 -->
                <div class="px-4 mb-6 sys-admin">
                    <p class="text-xs uppercase text-dark-2 font-semibold tracking-wider">系统管理</p>
                </div>
                
                <ul class="space-y-1 px-2 flex-1 overflow-y-auto scrollbar-hide sys-admin">
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-server w-5 text-center"></i>
                            <span>资源管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-cog w-5 text-center"></i>
                            <span>系统配置</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-user-circle-o w-5 text-center"></i>
                            <span>用户管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-lg text-dark-2 hover:bg-light-1 transition-all-300">
                            <i class="fa fa-history w-5 text-center"></i>
                            <span>日志与备份</span>
                        </a>
                    </li>
                </ul>

            </nav>
        </aside>

        <!-- 主内容区域 - iframe嵌套加载内容 -->
        <main class="flex-1 overflow-hidden bg-gray-50">
            <iframe id="content-frame" src="home.html" class="w-full h-full border-0"></iframe>
        </main>
    </div>
    
    <!-- 角色切换功能 -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const roleSelector = document.getElementById('role-selector');
            const contentFrame = document.getElementById('content-frame');
            const navLinks = document.querySelectorAll('aside nav a');
            
            // 初始化页面元素显示
            updateRoleVisibility(roleSelector.value);
            updateActiveMenu();
            
            // 角色切换事件
            roleSelector.addEventListener('change', function() {
                updateRoleVisibility(this.value);
            });
            
            // 更新角色相关元素的显示
            function updateRoleVisibility(role) {
                // 隐藏所有角色相关元素
                document.querySelectorAll('.team-admin, .sys-admin').forEach(el => {
                    el.classList.add('hidden');
                });
                
                // 显示对应角色的元素
                if (role === 'team-admin') {
                    document.querySelectorAll('.team-admin').forEach(el => {
                        el.classList.remove('hidden');
                    });
                } else if (role === 'sys-admin') {
                    document.querySelectorAll('.team-admin, .sys-admin').forEach(el => {
                        el.classList.remove('hidden');
                    });
                }
                
                // 更新活动菜单状态
                updateActiveMenu();
            }
            
            // 更新当前选中的菜单项
            function updateActiveMenu() {
                const currentUrl = contentFrame.src;
                const urlPath = currentUrl.split('/').pop();
                
                navLinks.forEach(link => {
                    // 移除所有活动状态
                    link.classList.remove('bg-primary/5', 'text-primary', 'font-medium');
                    link.classList.add('text-dark-2', 'hover:bg-light-1');
                    
                    // 为当前页面添加活动状态
                    const linkUrl = link.getAttribute('href');
                    
                    // 处理项目详情页的特殊情况，让它选中项目管理菜单
                    if (urlPath.includes('project_detail.html') && linkUrl === 'home.html') {
                        link.classList.remove('text-dark-2', 'hover:bg-light-1');
                        link.classList.add('bg-primary/5', 'text-primary', 'font-medium');
                    } 
                    // 正常页面匹配
                    else if (linkUrl && urlPath === linkUrl) {
                        link.classList.remove('text-dark-2', 'hover:bg-light-1');
                        link.classList.add('bg-primary/5', 'text-primary', 'font-medium');
                    }
                });
            }
            
            // 监听iframe加载完成事件，更新活动菜单
            contentFrame.addEventListener('load', function() {
                updateActiveMenu();
            });
            
            // 监听侧边栏链接点击，在iframe中加载对应页面
            navLinks.forEach(link => {
                link.addEventListener('click', function(e) {
                    const href = this.getAttribute('href');
                    if (href && href.startsWith('#')) {
                        // 内部锚点，不处理
                        return;
                    }
                    
                    if (href && href !== '') {
                        e.preventDefault();
                        contentFrame.src = href;
                    }
                });
            });
        });
    </script>
    
    <!-- 侧边栏切换 -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const sidebarToggle = document.getElementById('sidebar-toggle');
            const sidebar = document.getElementById('sidebar');
            
            sidebarToggle.addEventListener('click', function() {
                sidebar.classList.toggle('hidden');
                sidebar.classList.toggle('absolute');
                sidebar.classList.toggle('inset-y-0');
                sidebar.classList.toggle('left-0');
                sidebar.classList.toggle('z-50');
            });
        });
    </script>
    
    
</body>
</html>